import {HANDEL_NAME_CONFIG} from "@/views/checkPage/config/eventConfig";
import store from '@/store'

const setCurrentRouterName = (handelCode, path) => {
  const PARENT = 'parent';
  const CHILD = 'child';
  let routerType = ''
  let routerName = HANDEL_NAME_CONFIG[handelCode];
  switch (path) {
    case '/securityCheck/checkBusPage':
      routerType = PARENT
      break;
    case '/securityCheck/checkBusPageInfo':
      routerType = CHILD
      break;
  }
  if (routerType === '' || routerName == null || routerName === '') return;
  routerName = routerType === CHILD ? `${routerName}隐患` : routerName
  store.commit('routerName/SET_ROUTER_NAME_LIST', {path, routerName})
};

export {setCurrentRouterName}
